﻿using System;
using System.Collections;

namespace WenSkin.Controls
{
    public class WenCollection : IList
    {
        public ArrayList Items = new ArrayList();
        object IList.this[int index] { get => Items[index]; set => Items[index] = value; }

        public virtual bool IsReadOnly => Items.IsReadOnly;

        public virtual bool IsFixedSize => Items.IsFixedSize;

        public virtual int Count => Items.Count;

        public virtual object SyncRoot => Items.SyncRoot;

        public virtual bool IsSynchronized => Items.IsSynchronized;

        public virtual int Add(object value)
        {
            return Items.Add(value);
        }

        public virtual void AddRange(ICollection enumerable)
        {
            Items.AddRange(enumerable);
        }

        public virtual void Clear()
        {
            Items.Clear();
        }

        public virtual bool Contains(object value)
        {
            return Items.Contains(value);
        }

        public virtual void CopyTo(Array array, int index)
        {
            Items.CopyTo(array, index);
        }

        public virtual IEnumerator GetEnumerator()
        {
            return Items.GetEnumerator();
        }

        public virtual int IndexOf(object value)
        {
            return Items.IndexOf(value);
        }

        public virtual void Insert(int index, object value)
        {
            Items.Insert(index, value);
        }

        public virtual void Remove(object value)
        {
            Items.Remove(value);
        }

        public virtual void RemoveAt(int index)
        {
            Items.RemoveAt(index);
        }

        public virtual object[] ToArray()
        {
            return Items.ToArray();
        }
    }
}
